package com.example.springbean.pkg;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class Consume {


    @RabbitListener(queues = {"header.queue"})
    public void topicHeader(byte[] message, Message message2) {
        message2.getMessageProperties().getHeaders().forEach((e,v) -> System.out.println(v));
        System.out.println(new String(message));
    }
}
